/**
 * 
 */
package org.jrm.map;

import org.jrm.mechanics.GameItem;


/**
 * @author LAP
 *
 */
public class ContentMap implements GameMap {
	
	private GameItem[][] gameItems;
	
	public ContentMap(int width, int height) {
		gameItems = new GameItem[width][height];
	}
	
	@Override
	public GameItem getGameItem(Point position) { //TODO maybe need some done
		if (position == null) throw new NullPointerException("Position must be not null");
		return gameItems[position.getX()][position.getY()];
	}

	@Override
	public void setGameItem(Point position, GameItem item) {
		if ((position == null) || (item == null)) throw new IllegalArgumentException("Arguments must be not null");
		gameItems[position.getX()][position.getY()] = item;
	}
}
